Skip to content

Skip Form validating at first render#277

Open
duylam wants to merge 3 commits into
christianalfoni:masterfrom
duylam:master
Open

Skip Form validating at first render#277
duylam wants to merge 3 commits into
christianalfoni:masterfrom
duylam:master

Conversation

@duylam
Copy link
Copy Markdown

@duylam duylam commented Dec 3, 2015

This is to fix issue #254

@tanneess
Copy link
Copy Markdown

Hi I personally tried your fix. For my use case it missed one extra check in the attachToForm method. This method is also calling this.validate for each component that gets attached to the form => Validation at first render.

@duylam
Copy link
Copy Markdown
Author

duylam commented Dec 28, 2015

@tanneess Thanks for your feedback, I added the missing check in attachToForm method. Per the article in README.md (http://christianalfoni.github.io/javascript/2014/10/22/nailing-that-validation-with-reactjs.html) I assume the attachToForm() is called only in "mount" event

@eriknyk
Copy link
Copy Markdown

eriknyk commented Jun 14, 2016

any thoughts from maintainers? is something missing for the PR?

@aphillipo
Copy link
Copy Markdown

I could do with this being merged - I'm loading lots of data into my forms and validating it means the form is "changed" which it obviously isn't.

@brodrigu
Copy link
Copy Markdown

👍 for adding the functionality enabled by this PR.

@mikaelengstrom
Copy link
Copy Markdown

@Semigradsky Is there any reason this have not been merged? Let me know if I can help out in any way.

@andrewdavidcostello
Copy link
Copy Markdown

This is also a good PR for performance issues. Loading in 125 rows with 5 Selects in each rows causes validation to happen constantly and you have to wait 20 seconds till the form becomes available. This PR works fine for the most part but I get errors stating to remove the prop from the form tag.

The render method needs to be updated to include the prop in nonFormsyProps and in the list above.

To round off performance issues, ideally validation needs disabling when the component is unmounted as well as it tries to validate at this point also. For now I have added a simple check for this to set a validation = false in componentWillUnmount and a check at the top of validate form against it.

@Melonbwead
Copy link
Copy Markdown

is there any update on this ?

@Semigradsky
Copy link
Copy Markdown
Collaborator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants